package com.icehand.demo.service.strategy.handler;

import com.icehand.demo.dto.OrderDTO;
import com.icehand.demo.enums.OrderTypeEnums;
import com.icehand.demo.service.strategy.AbstractOrderHandler;
import com.icehand.demo.service.strategy.OrderProductServiceImpl;
import com.icehand.demo.service.strategy.annonation.OrderHandlerType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
@OrderHandlerType(type = OrderTypeEnums.NORMAL)
public class NormalOrderHandler extends AbstractOrderHandler {
    @Autowired
    private OrderProductServiceImpl orderProductService;

    @Override
    public String handle(OrderDTO dto) {
        return orderProductService.sayHello() + "普通订单【策略模式】";
    }
}
